<template>
  <div class="recording-clipping-container">
    <div class="page-header">
      <h1>直播录制与拆条</h1>
    </div>
    
    <!-- 统计卡片 -->
    <el-row :gutter="20" class="stats-row">
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <el-icon class="stat-icon"><VideoCamera /></el-icon>
            <div>
              <div class="stat-number">{{ totalRecordings }}</div>
              <div class="stat-label">直播录制个数</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <el-icon class="stat-icon"><Folder /></el-icon>
            <div>
              <div class="stat-number">{{ totalSize }}</div>
              <div class="stat-label">文件大小</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <el-icon class="stat-icon"><Scissor /></el-icon>
            <div>
              <div class="stat-number">{{ totalClipTasks }}</div>
              <div class="stat-label">拆条个数</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <el-icon class="stat-icon"><Loading /></el-icon>
            <div>
              <div class="stat-number">{{ processingClipTasks }}</div>
              <div class="stat-label">拆条中</div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    
    <!-- 标签页切换 -->
    <el-tabs v-model="activeTab" type="border-card" class="main-tabs enhanced-tabs" @tab-change="handleTabChange">
      <el-tab-pane label="录制管理" name="recordings">
        <RecordingList />
      </el-tab-pane>
      <el-tab-pane label="拆条任务" name="cliptasks">
        <ClipTaskList />
      </el-tab-pane>
    </el-tabs>
    
    <!-- 录制视频播放器对话框 -->
    <VideoPlayerDialog />
    
    <!-- 拆条预览对话框 -->
    <ClipPreviewDialog />
    
    <!-- 拆条对话框 -->
    <ClipDialog />
    
    <!-- 文件列表对话框 -->
    <FileListDialog />
  </div>
</template>

<script setup>
import { VideoCamera, Folder, Scissor, Loading } from '@element-plus/icons-vue'
import { useRecordingClipping } from './useRecordingClipping'
import RecordingList from './RecordingList.vue'
import ClipTaskList from './ClipTaskList.vue'
import VideoPlayerDialog from './VideoPlayerDialog.vue'
import ClipPreviewDialog from './ClipPreviewDialog.vue'
import ClipDialog from './ClipDialog.vue'
import FileListDialog from './FileListDialog.vue'

// 使用录制拆条功能钩子
const {
  activeTab,
  totalRecordings,
  totalSize,
  totalClipTasks,
  processingClipTasks,
  handleTabChange
} = useRecordingClipping()
</script>

<style scoped>
.recording-clipping-container {
  padding: 20px;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 24px;
  color: #303133;
}

.stats-row {
  margin-bottom: 20px;
}

.stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.stat-content {
  display: flex;
  align-items: center;
}

.stat-icon {
  font-size: 24px;
  margin-right: 12px;
  color: #1890ff;
}

.stat-number {
  font-size: 20px;
  font-weight: bold;
  color: #303133;
}

.stat-label {
  font-size: 12px;
  color: #606266;
}

.main-tabs {
  margin-top: 20px;
}

/* 优化标签样式使其更显眼 */
.enhanced-tabs {
  /* 标签头容器 */
  .el-tabs__header {
    margin-bottom: 10px;
  }
  
  /* 标签导航容器 */
  .el-tabs__nav {
    height: 48px;
  }
  
  /* 单个标签项 */
  .el-tabs__item {
    font-size: 16px;
    font-weight: 800; /* 进一步加粗 */
    padding: 0 24px;
    height: 48px;
    line-height: 48px;
    transition: all 0.3s ease;
  }
  
  /* 标签项悬停效果 */
  .el-tabs__item:hover {
    color: #1890ff;
    font-weight: 700;
    background-color: rgba(24, 144, 255, 0.05); /* 添加背景色 */
  }
  
  /* 当前激活的标签项 */
  .el-tabs__item.is-active {
    color: #1890ff;
    font-weight: 800; /* 最大加粗 */
    font-size: 17px;
    background-color: rgba(24, 144, 255, 0.1); /* 添加激活状态背景色 */
    border-radius: 4px 4px 0 0;
  }
  
  /* 激活标签的下划线指示器 */
  .el-tabs__active-bar {
    height: 4px; /* 增加高度 */
    background-color: #1890ff;
    border-radius: 2px;
  }
}
</style>